library Viewer;

uses
  Forms,
  SysUtils,
  Core_Types in '..\..\Core_Types.pas',
  WndMain in 'WndMain.pas' {WndViewerMain},
  AppInterface in '..\AppInterface.pas';

{var
  PluginInterface : TPluginInterface;   }

function ViewExt(Ext : PChar): Boolean;
//var
//  sext : String;
begin
  //sext := LowerCase(Ext);
  Result := true;
end;

function EditExt(Ext : PChar): Boolean;
begin
  Result := False;
end;

function ViewFile(FileName : PChar) : Integer;
begin
  AppFace._Application.CreateForm(TWndViewerMain, WndViewerMain);
  WndViewerMain.FileName := FileName;
  WndViewerMain.Caption := 'Komanda Viewer - [' + FileName + ']';
  WndViewerMain.LoadFile;
  WndViewerMain.Show;
end;

function PluginLoad(AppIntrfc : PAppInterface; PluginInt : PPluginInterface) : Integer;
begin
  PluginInt^.Name := 'Komanda Viewer';
  @PluginInt^.ViewExt := @ViewExt;
  @PluginInt^.EditExt := @EditExt;
  @PluginInt^.ViewFile := @ViewFile;

  AppFace := AppIntrfc^;
end;

exports
  PluginLoad;

begin
end.
